#include "Packet.h"



using namespace tmms::mmedia;


PacketPtr Packet::NewPacket(int32_t size)
{
    auto block_size =  size +sizeof(Packet);
    Packet * packet  = (Packet*)  new char[block_size];
    memset(packet ,0x00,block_size);
    packet->index_ = -1;
    packet->type_ = KPacketTypeUnknowed;
    packet->capacity_ = size;
    packet->ext_.reset();


    return PacketPtr(packet,[](Packet * p){
        delete [](char*)p;
    });

}
